package com.example.Lib;

public abstract class Duck {
    FlyBehavior flyBehavior;
    Quackbehavior quackBehavior;

    public void performQuack() {

        quackBehavior.quack();
    }
    public void performFly() {
        flyBehavior.fly();
    }

    public abstract void display();

    public void swim() {
        System.out.println("I can swim");
    }

    public void setFlyBehavior(FlyBehavior flyBehavior) {
        this.flyBehavior = flyBehavior;
    }

    public void setQuackBehavior(Quackbehavior quackBehavior) {
        this.quackBehavior = quackBehavior;
    }

}

